<?php
$filename = $_GET['name'];
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);



$contents = htmlspecialchars($contents);
$order   = array("\r\n", "\n", "\r");
$replace = '<br />';
$contents=str_replace($order, $replace,$contents);

/*
$order = array(" ");
$replace = "&nbsp;";
$contents=str_replace($order, $replace,$contents);


$order = array("\t");
$replace = '&nbsp;&nbsp;&nbsp;&nbsp;';
$contents=str_replace($order, $replace,$contents);
*/

echo $contents;

?>